class Solution:
    def findContentChildren(self, g, s):
        """
        :type g: List[int]
        :type s: List[int]
        :rtype: int
        """
        g.sort()
        s.sort()
        g_len = len(g)

        res = 0
        i = 0
        for s_j in s:
            if i >= g_len:
                return res
            if s_j >= g[i]:
                res += 1
                i += 1

        return res

s = Solution()
print(s.findContentChildren([1,2], [1,2,3]))
print(s.findContentChildren([10,9,8,7], [5,6,7,8]))

